#include <stdio.h>
#include <stdlib.h>

// compute the next highest power of 2 of 32-bit v
unsigned int roundUpPower2(unsigned int v)
{
	v--;
	v |= v >> 1;
	v |= v >> 2;
	v |= v >> 4;
	v |= v >> 8;
	v |= v >> 16;
	v++;
	
	return v;
}

int main()
{
	printf("the next highest power of 2 of %d is %d\n",100,roundUpPower2(100));
	return 0;
}
